package main

import "fmt"

func main()  {
	ch1:=make(chan int)
	done:=make(chan bool)
	go func(){
		for i:=0;i<100 ;i++  {
			ch1 <-i
			fmt.Println("生产者生产鸡蛋i:",i)
		}
		close(ch1)
	}()

	go func(){
		for n:=range ch1 {
			fmt.Println("消费者range1:",n)
		}
		done<-true
	}()

	go func(){
		for n:=range ch1 {
			fmt.Println("消费者range2:",n)
		}
		done<-true
	}()
	<-done
	<-done
	fmt.Println("main.....over....")
}
